x86/VPMU: Save/restore VPMU only when necessary
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Mon, 15 Apr 2013 09:27:32 +0000 (11:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Apr 2013 09:27:32 +0000 (11:27 +0200)
commit055898c9c61d462888941eaede436db4d335890e
treea7491be0bf478ca3530c56cf4f39d95defcc0ed8
parent426368be82b0184df1b537bb659680026b747a50
x86/VPMU: Save/restore VPMU only when necessary

VPMU doesn't need to always be saved during context switch. If we are
comming back to the same processor and no other VPCU has run here we can
simply continue running. This is especailly useful on Intel processors
where Global Control MSR is stored in VMCS, thus not requiring us to stop
the counters during save operation. On AMD we need to explicitly stop the
counters but we don't need to save them.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/arch/x86/hvm/vpmu.c
xen/include/asm-x86/hvm/vpmu.h